package org.finesys.chat.core.base.client;

import org.finesys.ai.core.chat.ChatCompletionResponse;
import org.finesys.ai.core.completion.CompletionResponse;
import org.finesys.ai.core.embedding.EmbeddingResponse;
import org.finesys.ai.core.image.GenerateImagesResponse;
import org.finesys.chat.core.base.chat.ChatRequest;
import org.finesys.chat.core.base.factory.ChatModel;
import reactor.core.publisher.Flux;

/**
 * 获取chatclient
 */
public interface ChatClient {


    /**
     * 获取唯一标识
     */
    String getKey();

    /**
     * 注册
     */
    void register(ChatModel chatModel);

    /**
     * 更新
     */
    void updateKey(ChatModel chatModel);

    /**
     * 取消注册
     */
    void unregister();

    /**
     * 补全接口
     */
    Flux<CompletionResponse> completion(ChatRequest chatRequest);


    /**
     * 会话接口
     */
    Flux<ChatCompletionResponse> chatCompletion(ChatRequest chatRequest);


    /**
     * 图片生成接口
     */
    Flux<GenerateImagesResponse> imageGeneration(ChatRequest chatRequest);


    /**
     * 嵌入接口
     */
    Flux<EmbeddingResponse> embedding(ChatRequest chatRequest);
}
